<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateProductLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('product_logs', function (Blueprint $table) {
            $table->id();
            $table->string('foreign')->nullable()->comment('操作类型');
            $table->unsignedBigInteger('foreign_key')->nullable()->comment('操作外键');
            $table->unsignedBigInteger('product_id')->nullable()->comment('产品ID');
            $table->ipAddress('ip')->comment('ip地址');
            $table->string('remark', 1000)->comment('说明');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('product_logs');
    }
}
